import request from '@/utils/request'

export function login(data) {
  return request({
    url: 'user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: 'user/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: 'user/logout',
    method: 'post'
  })
}

export function list(data) {
  return request({
    url: 'user/list',
    method: 'post',
    data
  })
}
export function myRoles(data) {
  return request({
    url: 'user/myRoles',
    method: 'post',
    data
  })
}
export function createUser(data) {
  return request({
    url: 'user/createUser',
    method: 'post',
    data
  })
}
export function updateUser(data) {
  return request({
    url: 'user/updateUser',
    method: 'post',
    data
  })
}
export function delUser(data) {
  return request({
    url: 'user/delUser',
    method: 'post',
    data
  })
}
export function switchUser(data) {
  return request({
    url: 'user/switchUser',
    method: 'post',
    data
  })
}

export function employeeList(data) {
  return request({
    url: 'user/employeeList',
    method: 'post',
    data
  })
}
export function createEmployee(data) {
  return request({
    url: 'user/createEmployee',
    method: 'post',
    data
  })
}
export function updateEmployee(data) {
  return request({
    url: 'user/updateEmployee',
    method: 'post',
    data
  })
}
export function delEmployee(data) {
  return request({
    url: 'user/delEmployee',
    method: 'post',
    data
  })
}

export function switchEmployee(data) {
  return request({
    url: 'user/switchEmployee',
    method: 'post',
    data
  })
}
